package com.hotdog.advice;


import com.hotdog.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 定义全局异常的处理类 返回值是一个json的串
 *
 * @author dell
 */
@RestControllerAdvice
public class MyException {

    @ExceptionHandler(RuntimeException.class)
    public Object exception(Exception e) {
        e.printStackTrace();
        return SysResult.fail();
    }
}
